// "Copyright [2021] <Copyright Shengkai Lin>"

// The central controller is responsible to manage the new
// tasks from the task generator, alloc gpus, routes, etc for
// the tasks, and manage the critical resources.

#ifndef RESOURCE_SCHEDULER_RESOURCE_SCHEDULER_H_
#define RESOURCE_SCHEDULER_RESOURCE_SCHEDULER_H_

#include <vector>
#include "ai_sim.h"
#include "network_controller/topo_manager.h"


namespace ai_sim {

class ResourceScheduler : public omnetpp::cSimpleModule{
 private:
    int numMachine;
    int numGpusperMachine;
    TopoManager *topos;


 public:
    // The following redefined virtual function holds the algorithm.
    void initialize() override;
    void handleMessage(omnetpp::cMessage *msg) override;
    // Can be used in optical cluster or traditional cluster

    void alloc_gpu_resource(taskboard&);

    void finish() override;
};
}  // namespace ai_sim

#endif  // RESOURCE_SCHEDULER_RESOURCE_SCHEDULER_H_
